package cn.green.components.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.web.authentication.rememberme.PersistentRememberMeToken;
import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository;

import java.util.Date;

/**
 * 自动登录信息表
 */
@Mapper
public interface SysPersistentLoginDao extends PersistentTokenRepository {
    //创建一个新的token(令牌)
    @Override
    void createNewToken(PersistentRememberMeToken token);
    //修改修改令牌
    @Override
    void updateToken(@Param("series") String series, @Param("tokenValue") String token, @Param("date") Date date);
    //根据series信息获取令牌
    @Override
    PersistentRememberMeToken getTokenForSeries(@Param("series") String series);
    //删除对应series信息的令牌
    @Override
    void removeUserTokens(@Param("series") String series);
}
